#include<stdio.h>
int main()
{
	int n,i;
	int x;
	int temp;
	scanf("%d",&n);
	int flag = 1;
	for(x=3;x<=9000000000;x++)
	{
		i = 0;
		temp = x;
		while(temp%n == 1)
		{
			i++;
			temp = (temp-1)-((temp-1)/n);
			if(i==n&&flag==1)
			{
				flag++;
				printf("%d\n",x);
				int ron = x;
				int mid;
				for(int j=0;j<n;j++)
				{
					mid = (ron-1)/n;
					ron -= (ron-1)/n;
					printf("%d\n",mid);
				}
			}		
		}
		if(flag==2)
		  break;
	}
	return 0;
}
